@extends('admin/layout/index')

@section('css')

<link rel="stylesheet" href="/web/css/page_page.css">

@endsection

@section('content')
<div class="mws-panel grid_8">
        <div class="mws-panel-header">
            <span><i class="icon-rss"></i> 公告列表</span>
        </div>
        <div class="mws-panel-body no-padding">
            <div id="DataTables_Table_1_wrapper" class="dataTables_wrapper" role="grid">
            <form action="/admin/notice/index" method="get">
                <div id="DataTables_Table_1_length" class="dataTables_length">  
                    <label> 显示
                        <select size="1" name="count" aria-controls="DataTables_Table_1">
                            <option value="10" @if(!empty($request['count']) && $request['count'] == 10) selected @endif>10</option>
                            <option value="25" @if(!empty($request['count']) && $request['count'] == 25) selected @endif>25</option>
                            <option value="50" @if(!empty($request['count']) && $request['count'] == 50) selected @endif>50</option>
                            <option value="100" @if(!empty($request['count']) && $request['count'] == 100) selected @endif>100</option>
                        </select> 
                    条</label>
                </div>
                <div class="dataTables_filter" id="DataTables_Table_1_filter">
                    <label>关键字: <input type="text" value="{{ $request['search'] or ''}}" name="search" aria-controls="DataTables_Table_1"></label>
                    <input type="submit" value="搜索">
                </div>
            </form>
            <table class="mws-datatable-fn mws-table dataTable" id="DataTables_Table_1" aria-describedby="DataTables_Table_1_info">
                <thead>
                    <tr role="row">
                        <th class="sorting_asc" style="width: 60px;">序号</th>
                        
                        
                        <th class="sorting_asc" style="width: 150px;">标题</th>
                       
                        <th class="sorting_asc" style="width: 60px;">类型</th>
                        <th class="sorting_asc" style="width: 250px;">创建时间</th>
                        <th class="sorting_asc" style="width: 180px;">操作</th>
                    </tr>
                </thead>
                
                <tbody role="alert" aria-live="polite" aria-relevant="all">
                @foreach($data as $k => $v)
                <tr class="odd" style="text-align:center">
                        <td class="  sorting_1">{{ $v['id'] }}</td>
                        <td class=" ">{{ $v['title'] }}</td>
                        <td class=" ">{{ $v['type'] }}</td>
                        <td class=" ">{{ $v['time'] }}</td>
                        <td class=" ">
                            <a href="/admin/notice/delete/{{$v['id']}}".$_GET['page'] style="color:black;font-size:20px;margin-left:20px;margin-right:20px;" title="删除" onclick="return confirm('确认要删除吗?')"><i class="icon-trash" ></i></a>
                            <a href="/admin/notice/edit/{{$v['id']}}" style="color:black;font-size:20px;margin-left:20px;margin-right:20px;" title="修改"><i class="icon-pencil-2" ></i></a>
                            
                        </td>                    
                </tr>
                @endforeach
                </tbody>
            </table>
            <div class="dataTables_info" id="DataTables_Table_1_info">显示 {{$start}} 到 {{$end}} 共 {{$sum}} 条</div>
            
                <div class="next paginate_button" id="page_page">
                    
                    {!! $data -> appends($request) -> render() !!}

                </div>          
            </div>
            
        </div>
    </div>

@endsection